package com.ssy.lingxi.report.api.enums;

import com.ssy.lingxi.common.language.LanguageHolder;

import java.util.Arrays;

/**
 *  招标操作类型枚举
 * @author ds
 * @date 2021/5/11
 * @version 2.0.0
 */
public enum PurchaseInviteTenderOperateTypeEnum {
    TO_BE_COMMIT_VALIFY_COUNT(1,"待提交审核招标","/memberCenter/procurementAbility/callForBids/readyAddBid"),
    TO_BE_VALIFY_STEP1_COUNT(2,"待审核招标（一级）",""),//todo ds
    TO_BE_VALIFY_STEP2_COUNT(3,"待审核招标（二级）",""),
    TO_BE_COMMIT_COUNT(4,"待提交招标","/memberCenter/procurementAbility/callForBids/readySubmitBid"),
    TO_BE_VALIFY_SIGNUP_COUNT(5,"待审核报名","/memberCenter/procurementAbility/callForBids/readyCheckedRegister"),
    TO_BE_QUALIFICATION_VALIFY_COUNT(6,"待资格预审.","/memberCenter/procurementAbility/callForBids/readyQualifityChecked"),
    TO_BE_EXPERT_EVALUATION_COUNT(7,"待专家评标","/memberCenter/procurementAbility/callForBids/readyExpertRemark"),
    TO_BE_COMMIT_EVALUATION_COUNT(8,"待提交评标报告","/memberCenter/procurementAbility/callForBids/readySubmitReport"),
    TO_BE_APPOINT_COUNT(9,"待定标","/memberCenter/procurementAbility/callForBids/readyConfirmBid"),
    TO_BE_APPOINT_STEP1_COUNT(10,"待审核定标（一级）","/memberCenter/procurementAbility/callForBids/readyCheckedConfirmFirst"),
    TO_BE_APPOINT_STEP2_COUNT(11,"待审核定标（二级）","/memberCenter/procurementAbility/callForBids/readyCheckedConfirmSecond"),
    TO_BE_CONFIRM_APPOINT_COUNT(12,"待确认定标","/memberCenter/procurementAbility/callForBids/readyPassBid"),
    TO_BE_WIN_TENDER_PUBLISH_COUNT(13,"待中标公示","/memberCenter/procurementAbility/callForBids/readySendBidNotice"),
    ;
    /**
     * 编码
     */
    private final Integer code;
    /**
     * 名称
     */
    private final String name;
    /**
     * 链接
     */
    private final String link;


    PurchaseInviteTenderOperateTypeEnum(Integer code, String name, String link) {
        this.code = code;
        this.name = name;
        this.link = link;
    }

    public static PurchaseInviteTenderOperateTypeEnum getEnum(Integer code) {
        return Arrays.stream(PurchaseInviteTenderOperateTypeEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(null);
    }


    public Integer getCode() {
        return code;
    }

    public String getName() {
        return LanguageHolder.getName(this.getClass(), this.code);
    }

    public String getLink() {
        return link;
    }
}
